<template>
    <div class="rating-container"  @click="titleClick">
      <span class="rating-label">{{ label }}</span>
      <span class="rating-value">{{ value }}</span>
      <!-- 可以根据需要添加样式类 -->
    </div>
  </template>
  
  <script setup>
    const props = defineProps({
        label: {
            type: String,
            required: true
        },
        value: {
            type: [String,Number],
            required: false
        }
    });
    const emit = defineEmits(['titleClick'])
    const titleClick = ()=> {
      console.log('titleClick')
        emit('titleClick', {name: props.label, value: props.value})
    }
  </script>
  
  <style scoped>
  .rating-container {
    display: flex;
    align-items: center;
  }
  .rating-label {
    margin-right: 5px;
  }
  </style>